{extend name="member/common/member_layout" /}

{block name="content"}


<div class="wrap">
    <div class="tabmenu">

        <!-- submenu-->
        {include file="member/common/submenu"}

        <a href="javascript:void(0)" class="ncbtn ncbtn-bittersweet" nc_type="dialog"
           dialog_title="新增地址" dialog_id="my_address_edit" uri="/member/Address/address?type=add" dialog_width="550"
           title="新增地址"><i
                class="icon-map-marker"></i>新增地址</a>
        <?php if (sysconf('delivery_isuse')) { ?>
        <a href="javascript:void(0)" class="ncbtn ncbtn-bittersweet" style="right: 100px;" nc_type="dialog"
           dialog_title="使用代收货（自提）" dialog_id="daisou" uri="/member/Address/delivery_add"
           dialog_width="900" title="使用自提服务站"><i class="icon-flag"></i>使用自提服务站</a>
        <?php } ?>
    </div>
    <div class="alert alert-success">
        <h4>操作提示：</h4>
        <ul>
            <li>最多可保存20个有效地址</li>
        </ul>
    </div>
    <table class="ncm-default-table">
        <thead>
        <tr>
            <th class="w80">收货人</th>
            <th class="w150">所在地区</th>
            <th class="tl">街道地址</th>
            <th class="w120">电话/手机</th>
            <th class="w100"></th>
            <th class="w110">操作</th>
        </tr>
        </thead>
        <?php if(!empty($address_list)){?>
        <tbody>
        <?php foreach($address_list as $key=>$address){?>
        <?php $address['address'] = $address['type'].$address['address']?>
        <tr class="bd-line">
            <td><?php echo $address['true_name'];?></td>
            <td><?php echo $address['area_info'];?></td>
            <td class="tl"><?php echo $address['address'];?></td>
            <td><p><i class="icon-phone"></i><?php echo $address['tel_phone'];?></p>
                <p><i class="icon-mobile-phone"></i><?php echo $address['mob_phone']; ?></p></td>
            <td><?php if ($address['is_default'] == '1') {?>
                <i class="icon-ok-sign green" style="font-size: 18px;"></i>默认地址
                <?php } ?></td>
            <td class="ncm-table-handle"><span>
          <?php if (intval($address['dlyp_id'])) { ?>
                <a href="javascript:void(0);" class="btn-bluejeans" dialog_id="daisou" dialog_width="900" dialog_title="编辑地址" nc_type="dialog"
                   uri="/member/Address/delivery_add?id=<?php echo $address['address_id'];?>"><i
                        class="icon-edit"></i>
          <p>编辑</p>
          </a>
                <?php } else { ?>
                <a href="javascript:void(0);" class="btn-bluejeans" dialog_id="my_address_edit" dialog_width="550"
                   dialog_title="编辑地址" nc_type="dialog"
                   uri="/member/Address/address?type=edit&id=<?php echo $address['address_id'];?>"><i
                        class="icon-edit"></i>
          <p>编辑</p>
          </a>
                <?php } ?>
          </span>
                <span><a href="javascript:void(0)" class="btn-grapefruit"
                           onclick="ajax_get_confirm('您确定要删除吗?', '/member/Address/address?id=<?php echo $address['address_id'];?>');"><i class="icon-trash"></i>
          <p>删除</p>
          </a></span></td>
        </tr>
        <?php }?>
        <?php }else{?>
        <tr>
            <td colspan="20" class="norecord">
                <div class="warning-option"><i>&nbsp;</i><span>暂无符合条件的数据记录</span></div>
            </td>
        </tr>
        <?php }?>
        </tbody>
    </table>
</div>
<?php if (sysconf('delivery_isuse')) { ?>
<script src="__SITE_RESOURCE__/js/jquery.ajaxContent.pack.js" type="text/javascript"></script>
<?php } ?>


{/block}

